<script>
export default {
  globalData: {
    appsecret: "Y61szjr0G6cd4H254gzodswP",
    // h5正式发布打包使用window.location.origin
    // rootUrl: 'https://jxsdj.caidj.net.cn', //主接口地址
    // rootUrl: 'http://pay.caidj.cn', //线上测试（h5跨域。小程序可）
    // rootUrl: 'http://pay.caidj.net', //线上
    // rootUrl: 'http://supply.caidj.com', //小程序线上
    // rootUrl: 'https://sdj.caidj.net.cn', //少东家小程序
    rootUrl: window.location.origin,
    // rootUrl: 'http://hebxc.caidj.net.cn', //小程序线上
    // rootUrl: 'http://cdj.local.gyl.com', //测试系统地址
    // rootUrl: 'https://new.caidj.net.cn', //测试系统地址
    // rootUrl: 'https://test.caidj.net.cn', //测试系统地址
    // rootUrl: "https://zjy.caidj.net.cn",
    // rootUrl: "https://dhsx.caidj.net.cn",
    // rootUrl: "http://cqnx.caidj.net.cn",

    nodataImg: "/static/image/nodata.png",
    nodataImgCart: "/static/image/cart_nodata.png",
    imgRemote: "https://test.caidj.cn",
    sourceImage: "/static/image/goods_demo.jpeg",
    cartTag: "", //购物车徽标
    sourceShowStartPage: true, //溯源加载启动页
    tabIndex: 0,

    // 主题配置
    themeConfig: {
      bottom_tab_icon: [], // 底部图标
      category_icon: [], // 分类图标
      background_image: "https://copartner.oss-cn-beijing.aliyuncs.com/logo/2401/17/kBTemVLjvz0h82TJUI0WfCG896mgCffBC4vuL64K.png", // 首页背景图
      sale_img: "https://copartner.oss-cn-beijing.aliyuncs.com/logo/2411/22/BW1jbbJ9uvoOp5BRKC3qvBAFQEuGgUWMBBNWjDK4.png", // 首页显示抢购图片
      sale_background_img: "https://copartner.oss-cn-beijing.aliyuncs.com/logo/2411/23/0LCVLXgAfVTNE44VC0JGlRE3tU51Egq3VB2lI460.png", // 限时抢购图片
      text_color: "#000000", // 文字颜色
      text_color2: "#40AE36", // 倒计时色块色值
      theme_color: "#F6F6F7", // 主题色
      user_center_img: "https://copartner.oss-cn-beijing.aliyuncs.com/logo/2411/25/BnhIeUFxVPBunCrCE7vo6YV3e3xOryTHkKBVvE0m.png", // 个人中心图片
      valid: 2, // 1 有效 2 无效
    },
    // appid:wxd1a8b83258c39658		//少东家小程序
    // appid:wxf8e6901dbc0c180a		//小程序
    // appid:wx4f24afa0c5d9be68		//小程序支付
  },
  onLaunch: function () {
    // uni.hideTabBar();
    //#ifdef MP-WEIXIN
    let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {};
    let url = extConfig.attr.host;
    this.globalData.rootUrl = url;
    //#endif
    uni.hideTabBar();
  },
  onShow: function () {
    uni.hideTabBar();
    let themeConfig = uni.getStorageSync("themeConfig");
    if(themeConfig.valid == 1) this.globalData.themeConfig = uni.getStorageSync("themeConfig");
  },
  onHide: function () {},
  methods: {
    setTitle() {
      //#ifndef MP-WEIXIN
      uni.setNavigationBarTitle({
        title: uni.getStorageSync("title"),
      });
      //#endif
      uni.hideTabBar();
    },
  },
};
</script>

<style lang="scss">
@import "./static/iconfont.css";
@import "uview-ui/index.scss";

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-btw {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-end {
  display: flex;
  justify-content: flex-end !important;
  align-items: center;
}

.flex-around {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.flex-middle {
  display: flex;
  align-items: center;
}

.flex-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/deep/.uni-tabbar-border {
  background: none !important;
}

.nodata {
  z-index: -1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  color: #cccccc;
  font-size: 32rpx;
  width: 400rpx;

  image,
  img {
    width: 100%;
    height: 300rpx;
    margin-bottom: 54rpx;
  }
}

.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}

/* #ifdef H5 */
body {
  // max-width: 600px;
  margin: 0;
  padding: 0;
}

/* #endif */
page {
  background: #f6f6f7;
}

.flex {
  display: flex;
}

.flex_row_center {
  justify-content: center;
}

.flex_col_center {
  align-items: center;
}

.flex_row_between {
  justify-content: space-between;
}

.flex_row_around {
  justify-content: space-around;
}

.wrap {
  flex-wrap: wrap;
}

.placehoder_class {
  font-size: 24rpx;
  color: #c0c0c0;
}

.wxnavbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}
.status_bar {
  // #ifdef APP-PLUS
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  // #endif
  //#ifndef MP-WEIXIN
  height: var(--status-bar-height);
  // #endif
  background: #f6f6f7;
  width: 100%;
  z-index: 1000;
}
.sticky-header {
  position: -webkit-sticky; // 对于微信小程序，需要使用-webkit-sticky
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #fff; // 确保背景色与页面背景一致
}

.text_right {
  text-align: right;
}

.text_center {
  text-align: center;
}

.red_font {
  color: red !important;
}

.gray_font {
  color: #ccc;
}

.dgreen {
  color: $dgreen;
}

.bold {
  font-weight: bold;
}

.red_tag {
  background: red;
  border-radius: 6rpx;
  color: white;
  font-size: 24rpx;
  padding: 2rpx 6rpx;
  margin-right: 6rpx;
}

// .logo {
// 	width: 50rpx;
// 	height: 40rpx;

// }

.recommend_good {
  .title {
    font-weight: 700;
    font-size: 32rpx;
    margin: 40rpx 0;
  }

  .all_good {
    flex-wrap: wrap;

    .sign_good {
      width: 48%;
    }

    .sign_good:nth-child(n + 3) {
      margin-top: 4%;
    }
  }
}

.border_bottom {
  border-bottom: 1px solid #e7e8e8;
}

.form_submit {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  .button {
    // position: fixed;
    bottom: 182rpx;
    background: $dgreen;
    width: 576rpx;
    text-align: center;
    color: $white;
    border-radius: 50rpx;
    height: 88rpx;
    line-height: 88rpx;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  }
}

.one_ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column_start {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.column_evenly {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.row_between {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.row_start {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
}

.fonts_38 {
  font-size: 38rpx;
  color: #333;
}
.fonts_34 {
  font-size: 34rpx !important;
  color: #333;
}
.fonts_32 {
  font-size: 32rpx;
  color: #333;
}
.fonts_30 {
  font-size: 30rpx;
  color: #333;
}
.fonts_28 {
  font-size: 28rpx;
  color: #333;
}
.fonts_26 {
  font-size: 26rpx;
  color: #333;
}
.fonts_24 {
  font-size: 24rpx;
  color: #666;
}
.fonts_20 {
  font-size: 20rpx;
  color: #666;
}
</style>
